// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
import QtQuick 1.1

Rectangle {
    width: 250
    id: main
    height: 30
    color: "#00000000"
    signal openFullTime()
    MouseArea{
        x:0;y:0;width:parent.width;height:parent.height
        onClicked: {console.log("time widget clicked");openFullTime();}
    }

    function getTime() {
        var pm = 0;
        var currentTime = new Date();
        var hours = currentTime.getHours();
        if(hours > 12 ){ pm=1; hours=hours-12;}
        if(hours < 10 ) {hours = "0" + hours;}
        var minutes = currentTime.getMinutes();
        if(minutes < 10 ) minutes = "0" + minutes;
        var retVal = ""+hours+":"+minutes;
        if(pm==1) retVal = retVal + "PM";
        else retVal = retVal + "AM";
        return retVal
    }
    Text {
        id: name
        width:parent.width
        height: parent.height
        text: qsTr(getTime())
        verticalAlignment: Text.AlignVCenter
        horizontalAlignment: Text.AlignHCenter
        font.pixelSize: 48

    }

}
//Westin
